﻿using dd.Core.Tasks;
using dd.Tasks.Dtos;
using System;
using System.Collections.Generic;

namespace dd.Web.Models.Tasks
{
	public class IndexViewModel
	{
		public IReadOnlyList<TaskListDto> Tasks { get; }

		public IndexViewModel(IReadOnlyList<TaskListDto> tasks)
		{
			Tasks = tasks;
		}

		public string GetTaskLabel(TaskListDto task)
		{
			switch (task.State)
			{
				case TaskState.Open:
					return "label-success";
				default:
					return "label-default";
			}
		}
	}
}
